import request from '@/utils/request.js'

/**
 * 获取待审批数据
 */
export function getPendingTasks(pager, params) {
	return request.post({
		url: '/business/v3/bpm/received/query/pending/user',
		pager,
		params,
		type: 1
	});
}

/**
 * 获取已审批数据
 */
export function getHandledTasks(pager, params) {
	return request.post({
		url: '/business/v3/bpm/received/query/handled',
		pager,
		params,
		type: 1
	});
}

/**
 * 获取我发起的数据
 */
export function getInitiateTasks(pager, params) {
	return request.post({
		url: '/business/v3/bpm/initiated/query/my/requested',
		pager,
		params,
		type: 1
	});
}

/**
 * 获取流程定义数据
 */
export function getFlowDefinition() {
	let params = []
	params.push({
		key: "Q^status_^S",
		value: "deploy"
	})
	params.push({
		key: "isSuper",
		value: true
	})
	
	return request.post({
		url: '/business/v3/bpm/definition/query',
		params,
		type: 1
	});
}